package com.bestcem.xm.txtanls.dao;

import com.bestcem.xm.txtanls.entity.pojo.ViewpointDO;

import java.util.List;


/**
 * mongo TXTANLS_VIEWPOINT 相关DAO层方法
 *
 * @author XiaoYunSong <ys.xiao@idiaoyan.com>
 * @version v1.0
 * @date 2021/5/11-14:07
 */
public interface ViewpointDao {

    /**
     * 根据id和类型查询观点
     *
     * @param id 观点id
     * @return Viewpoint 观点
     * @author jy.zhao
     * @date 2021/7/28 12:21
     **/
    ViewpointDO getById(String id);

    /**
     * 根据项目id查询观点列表
     *
     * @param projectId 项目id
     * @return List<ViewpointEntity> 观点列表
     * @author jy.zhao
     * @date 2021/5/13 13:56
     **/
    List<ViewpointDO> listViewpoints(String projectId);

    /**
     * 查询项目下所有的子观点
     *
     * @param projectId 项目id
     * @return Project all children viewpoint
     * @author gy.liu
     * @date 2021/5/11 14:20
     **/
    List<ViewpointDO> findAllChildrenViewPoint(String projectId);

    /**
     * 插入父观点
     *
     * @param viewContent 观点翻译内容
     * @param projectId   文本分析项目id
     * @param industryId  行业id
     * @return Created parent viewpoint
     * @author XiaoYunSong <ys.xiao@idiaoyan.cn>
     * @date 2021/5/12 18:07
     */
    String insertParentViewpoint(String viewContent, String projectId, String industryId);

    /**
     * 插入子观点
     *
     * @param viewContent 观点翻译内容
     * @param rowContent  观点源内容
     * @param projectId   文本分析项目id
     * @param parentId    父观点id
     * @param industryId  行业id
     * @return Created parent viewpoint
     * @author XiaoYunSong <ys.xiao@idiaoyan.cn>
     * @date 2021/5/12 18:07
     */
    void insertChildrenViewpoint(String viewContent, String rowContent, String projectId, String parentId, String industryId);

    /**
     * 删除分析项目下的全部观点
     *
     * @param projectId 项目id
     * @return The result of a delete operation
     * @author XiaoYunSong <ys.xiao@idiaoyan.cn>
     * @date 2021/5/12 18:07
     */
    boolean deleteProjectAllViewpoint(String projectId);


    /**
     * 新增观点
     * @param viewpoint
     * @return
     */
    ViewpointDO insertViewpoint(ViewpointDO viewpoint);

    /**
     * 查询父观点的所有子观点
     * @param viewpointId
     * @param projectId
     * @return
     */
    List<ViewpointDO> listChildrenViewpoint(String viewpointId, String projectId);

}
